<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no"/>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>发布病例</title>
    <link rel="stylesheet" href="business/style/common.css?<?=版本?>">
    <script src="business/resource/js/jquery-1.11.1.min.js"></script>
    <script src="//res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script src="app/js/common.js"></script>
</head>
<!-- 配置文件 -->
<script type="text/javascript" src="business/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="business/ueditor/ueditor.all.min.js"></script>
<!-- 实例化编辑器 -->
<script type="text/javascript">

    function fun() {
        var ue = UE.getEditor('container', {
            toolbars: [
                ['fullscreen', 'source', '|', 'undo', 'redo', '|',
                    'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'pasteplain', '|', 'forecolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
                    'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
                    'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
                    'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'link', 'unlink', 'anchor', '|',
                    'simpleupload', 'emotion']
            ],
            autoHeightEnabled: true,
            autoFloatEnabled: true
        });
    }

    //下面用于图片上传预览功能
    function setImagePreview(avalue) {
        var docObj=document.getElementById("doc"+avalue);

        var imgObjPreview=document.getElementById("preview"+avalue);
        if(docObj.files && docObj.files[0])
        {
//火狐下，直接设img属性
            imgObjPreview.style.display = 'block';
            imgObjPreview.style.width = '44px';
            imgObjPreview.style.height = '44px';
//imgObjPreview.src = docObj.files[0].getAsDataURL();

//火狐7以上版本不能用上面的getAsDataURL()方式获取，需要一下方式
            imgObjPreview.src = window.URL.createObjectURL(docObj.files[0]);
        }
        else
        {
//IE下，使用滤镜
            docObj.select();
            var imgSrc = document.selection.createRange().text;
            var localImagId = document.getElementById("localImag"+avalue);
//必须设置初始大小
            localImagId.style.width = "44px";
            localImagId.style.height = "44px";
//图片异常的捕捉，防止用户修改后缀来伪造图片
            try{
                localImagId.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)";
                localImagId.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgSrc;
            }
            catch(e)
            {
                alert("您上传的图片格式不正确，请重新选择!");
                return false;
            }
            imgObjPreview.style.display = 'none';
            document.selection.empty();
        }
        return true;
    }

    wx.config({
        debug: false,
        appId: '<?php echo $this->signPackage["appId"];?>',
        timestamp: <?php echo $this->signPackage["timestamp"];?>,
    nonceStr: '<?php echo $this->signPackage["nonceStr"];?>',
            signature: '<?php echo $this->signPackage["signature"];?>',
            jsApiList: [
        'onMenuShareAppMessage',
        'onMenuShareTimeline',
        'onMenuShareQQ',
        'onMenuShareWeibo',
        'onMenuShareQZone'
    ]
    });

    wx.ready(function(){
        wx.hideAllNonBaseMenuItem();
    });

</script>

<script>
    $(function(){
        $("#okn").click(function(){
            $title = $.trim($("input[name='title']").val());
            if($title.length == 0){
             alert("标题为必填项！");
                return false;
             }
             $('form1').submit();
        });
        $(".case_creat select").click(function(){
                    $(".case_creat select").css("color","#333");
             }
        )
    })
</script>
<body onload="fun()">
<form action="" method="post" id="form1" enctype="multipart/form-data">
<div class="header"><a href="<?= $case_list_url?>"  class="return">返回</a><input  type="submit"  class="btn btn-lg btn-success " name="okn" id="okn" value="发布" /></div>
<div class="case_creat">
    <div class="line"></div>
    <div class="form_box">
        <div class="txt"><input name="title"    type="text" id="keyword" placeholder="请填写标题，必填项" onFocus="if(value==defaultValue){value='';this.style.color='#333'}" onBlur="if(!value){value=defaultValue;this.style.color='#DB3656'}" /></div>
    </div>
    <div class="line"></div>
    <div class="form_box">
        <div class="txt"><input name="关键词" id="关键词" type="text"   placeholder="病历关键词（多个关键词请用英文逗号隔开）" onFocus="if(value==defaultValue){value='';this.style.color='#333'}" onBlur="if(!value){value=defaultValue;this.style.color='#CCC'}" /></div>
    </div>
    <div class="line"></div>
    <div class="upload_imgs">
        <ul>
            <li><div> <div id="localImag1"><img id="preview1" src="<?=G_SITE_CDN?>/business/style/add_img.png" width="44" height="44" style="display: block; width: 44px; height: 44px;"></div><input type="file" id="doc1" onchange="javascript:setImagePreview(1);" name="pic[]" >
                    </div></li>
            <li><div><div id="localImag2"><img id="preview2" src="<?=G_SITE_CDN?>/business/style/add_img.png" width="44" height="44" style="display: block; width: 44px; height: 44px;"></div><input type="file" id="doc2" onchange="javascript:setImagePreview(2);" name="pic[]" >
                   </div></li>
            <li><div><div id="localImag3"><img id="preview3" src="<?=G_SITE_CDN?>/business/style/add_img.png" width="44" height="44" style="display: block; width: 44px; height: 44px;"></div> <input type="file" id="doc3" onchange="javascript:setImagePreview(3);" name="pic[]">
                   </div></li>
            <li><div><div id="localImag4"><img id="preview4" src="<?=G_SITE_CDN?>/business/style/add_img.png" width="44" height="44" style="display: block; width: 44px; height: 44px;"></div><img src="<?=G_SITE_CDN?>/business/style/add_img.png" /> <input type="file" id="doc4" onchange="javascript:setImagePreview(4);" name="pic[]">
                   </div></li>
            <li><div><div id="localImag5"><img id="preview5" src="<?=G_SITE_CDN?>/business/style/add_img.png" width="44" height="44" style="display: block; width: 44px; height: 44px;"></div><img src="<?=G_SITE_CDN?>/business/style/add_img.png" /> <input type="file" id="doc5" onchange="javascript:setImagePreview(5);" name="pic[]"></li>
        </ul>


    </div>
    <div class="line mt10"></div>
    <div class="form_box">
        <div class="txt"><textarea id="container" name="content" placeholder="病例补充说明"></textarea></div>
    </div>
    <div class="line"></div>
    <div class="line mt10"></div>
    <div class="form_box"><select name="区域id" >
            <?php
            foreach($area_list as $show){
                echo '<option value="'.$show['id'].'" > '.$show['区域'].' </option>';} ?>
        </select></div>
    <div class="line"></div>
   <!-- <div class="form_box"> <select name="医院id" >
            <?php
            foreach($所有医院 as $show){
                echo '<option value="'.$show->data['id'].'" > '.$show->data['医院'].' </option>';} ?>
        </select>
        </select></div>
-->
   <div class="form_box"><div class="txt"><input name="医院id" type="text" id="医院id" value="所在医院" onFocus="if(value==defaultValue){value='';this.style.color='#000'}" onBlur="if(!value){value=defaultValue;this.style.color='#DB3656'}" /></div></div>
    <div class="line"></div>
    <!--医生列表 begin-->
<!--    <div class="dr_list">-->
<!--        <div class="dr_list_t">邀请专家回答：</div>-->
<!--        <ul>-->
<!--            --><?php
//            foreach($所有可关联人员 as $show){
//
//                echo '<li><div class="check_box"><input name="专家id[]" type="checkbox" value="'.$show['id'].'" id="'.$show['id'].'" /><label for="'.$show['id'].'"><div>'.$show['显示名称'].' </div></label></div></li>';
//            }
//            ?>
<!---->
<!---->
<!--        </ul>-->
<!--    </div>-->
    <!--医生列表 end-->
</div>
</form>
<?php require 'app/templates/common/download.html'; ?>
<?php require 'app/templates/common/foot.html'; ?>
</body>
</html>
